local daimashikong = fk.CreateSkill{
    name = "ym1__daimashikong",
    tags = {Skill.Limited},
    dynamic_desc = function(self, player)
        if player:getMark("@@ym1__daimashikong") ~= 0  or math.random() > 0.6 then
            return "ym1__daimashikong_fix"
        else
            return ""
        end
    end,
}
Fk:loadTranslationTable{
    ["ym1__daimashikong"] = "代码失控",
    [":ym1__daimashikong"] = "限定技，回合结束时，你可获得“和我在一起！”并删除“甜蜜陷阱”中的“你与”，然后杀死自己并休整至下轮开始时。",
    [":ym1__daimashikong_fix"] = "闄愬畾鎶�锛屽洖鍚堢粨鏉熸椂锛屼綘鍙幏寰椻�滃拰鎴戝湪涓�璧凤紒鈥濆苟鍒犻櫎鈥滅敎铚滈櫡闃扁�濅腑鐨勨�滀綘涓庘�濓紝鐒跺悗鏉�姝昏嚜宸卞苟浼戞暣鑷充笅杞紑濮嬫椂銆�",
    ["@@ym1__daimashikong"] = "浠ｇ爜澶辨帶",
    ["$ym1__daimashikong"] = "Ты всем нравишься, все хотят быть с тобой, все хотят, чтобы тебя видели.",

    ["$ym1__daimashikong1"] = "我好像掉了什么东西，我马上回来...然后我们就可以前往另一个世界了...",
    ["$ym1__daimashikong2"] = "你弄丢了什么东西吗？来啊，重新认识一下她吧！",
}
daimashikong:addEffect(fk.TurnEnd,{
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(daimashikong.name) and player:usedSkillTimes(daimashikong.name, Player.HistoryGame) == 0 and player:getMark("@@ym1__daimashikong") == 0
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        room:notifySkillInvoked(player,daimashikong.name,"big")
        player:broadcastSkillInvoke(daimashikong.name,1)
        room:setPlayerMark(player, "@@ym1__daimashikong", 1)
        room:handleAddLoseSkills(player,"ym1__hewozaiyiqi",daimashikong.name)
        player.tag[daimashikong.name] = true
        player.tag["ym1__tianmixianjing"] = player:getMark("ym1__tianmixianjing")
        room:killPlayer({ who = player })
        --[[player._splayer:setDied(false)
        room:setPlayerRest(player, 1)
        player.dead = true
        table.removeOne(room.alive_players, player)
        room:broadcastProperty(player, "dead")]]--
    end,
})
daimashikong:addEffect(fk.BeforeGameOverJudge,{
    can_refresh = function (self, event, target, player, data)
        return ( player.rest > 0 or event == fk.BeforeGameOverJudge ) and player.tag[daimashikong.name]
    end,
    on_refresh = function (self, event, target, player, data)
        local room = player.room
        player._splayer:setDied(false)
        room:setPlayerRest(player, 1)
    end,
})
daimashikong:addEffect(fk.RoundStart,{
    can_refresh = function (self, event, target, player, data)
        return player.rest > 0 and player.tag[daimashikong.name]
    end,
    on_refresh = function (self, event, target, player, data)
        local room = player.room
        if player.general == "ym1__MiSide" then
            player.general = "ym1__MiSide2"
            room:broadcastProperty(player, "general")
        end
        player:broadcastSkillInvoke(daimashikong.name,2)
        player.tag[daimashikong.name] = nil
        room:setPlayerRest(player, 0)
        if player.dead then
            room:revivePlayer(player, false, "rest")
        end
        local x = player.maxHp - player.hp
        if x ~= 0 then
            room:changeHp(player, x, nil, daimashikong.name)
        end
        if 4 - player:getHandcardNum() > 0 then
            room:drawCards(player,4 - player:getHandcardNum())
        end
        room:setPlayerMark(player, "@@ym1__daimashikong", 1)
        room:setPlayerMark(player, "ym1__tianmixianjing", player.tag["ym1__tianmixianjing"])
        player.tag["ym1__tianmixianjing"] = nil
    end,
})
return daimashikong